import request from '@/utils/request'

// 查询物料分类列表
export function listStock1(query) {
  return request({
    url: '/stock/stock/list1',
    method: 'get',
    params: query
  })
}

// 查询物料分类详细
export function getStock1(itemTypeId) {
  return request({
    url: '/stock/stock/getStock1' + itemTypeId,
    method: 'get'
  })
}



// 查询库存现有量列表
export function listStock(query) {
  console.log(query);
  
  return request({
    url: '/stock/stock/list',
    method: 'get',
    params: query
  })
}

// 查询库存现有量详细
export function getStock(materialStockId) {
  return request({
    url: '/stock/stock/' + materialStockId,
    method: 'get'
  })
}

// 新增库存现有量
export function addStock(data) {
  return request({
    url: '/stock/stock',
    method: 'post',
    data: data
  })
}

// 修改库存现有量
export function updateStock(data) {
  return request({
    url: '/stock/stock',
    method: 'put',
    data: data
  })
}

// 删除库存现有量
export function delStock(materialStockId) {
  return request({
    url: '/stock/stock/' + materialStockId,
    method: 'delete'
  })
}
//根据itemId删除库存现有量
export function delItem1(itemId) {
  return request.post(`/stock/stock/deleteMaterialStockByItemId?itemId=${itemId}`)
  
}